package good_src.Implementation;

import java.util.Collection;
import java.util.Observer;

import good_src.Interfaces.Algorithme;
import good_src.Interfaces.ObservateurCapteur;
import good_src.Interfaces.Subject;

/**
 * @author Tangi Midy & Fabien Le Peih
 *         <p>
 *         This class is used for the Sequential Strategy
 *         </p>
 *        <p>
 *         It simulates a capteur and keep the correct value for the requesters
 *         </p>
 */
public class CapteurProxy implements Subject<Integer> {

	private Collection<ObservateurCapteur> canaux;
	private int value;
	private Algorithme algo;

	/**
	 * 
	 */
	public CapteurProxy() {
	}

	/**
	 * 
	 * @return the observers collection
	 */
	public Collection<ObservateurCapteur> getCanaux() {
		return canaux;
	}

	/**
	 * 
	 * @param canaux
	 *            the observers collection to set
	 */
	public void setCanaux(Collection<ObservateurCapteur> canaux) {
		this.canaux = canaux;
	}

	public void setValue(Integer value) {
		this.value = value;
	}

	@Override
	public Integer getValue() {
		return this.value;
	}

	/**
	 * @see good_src.Interfaces.Subject#SetStrategy()
	 */
	@Override
	public void setStrategy(Algorithme algo) {
		this.algo = algo;
	}

	/**
	 * 
	 * @see good_src.Interfaces.Subject#getStrategy()
	 */
	@Override
	public Algorithme getStrategy() {
		return this.algo;
	}

	/*********************************************** UNUSED METHODS ************************************************************/

	@Override
	public void detach(Observer observer) {
		// TODO Auto-generated method stub

	}

	@Override
	public void attach(Observer observer) {
		// TODO Auto-generated method stub

	}

	@Override
	public void tick() {
		// TODO Auto-generated method stub

	}

	@Override
	public void update() {
		// TODO Auto-generated method stub

	}

	@Override
	public int getVersion() {
		// TODO Auto-generated method stub
		return 0;
	}

	/**
	 * @see good_src.Interfaces.Subject#setCanaux(int)
	 */
	@Override
	public void setCanaux(int displayers) {
		// TODO Auto-generated method stub

	}

}
